﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EditAllMask : MonoBehaviour
{
    public Material textMaterial;
    public Shader spriteShader;
    // Start is called before the first frame update
    void Awake()
    {
        UILabel[] uILabels = transform.GetComponentsInChildren<UILabel>();
        UISprite[] uISprites = transform.GetComponentsInChildren<UISprite>();
        foreach (UILabel uILabel in uILabels)
        {
            uILabel.material = textMaterial;
        }
        Material material = null;
        foreach (UISprite uISprite in uISprites)
        {

            if (material == null)
            {
                material = new Material(uISprite.material);
                material.shader = spriteShader;
                material.name = "sprite";
            }
            uISprite.mMaterial = material;
        }
    }

    // Update is called once per frame
    void Update()
    {

    }
}
